package com.zhihao.domain.strategy.service.armory;

import java.util.Date;

/**
 * @author Jackson
 * @create 2025/3/9 19:26
 * @description 策略抽奖调度(抽奖的流程性调度)
 */
public interface IStrategyDispatch {

    /**
     * 获取抽奖策略装配的随机结果
     *
     * @param strategyId 策略ID
     * @return 抽奖结果
     */
    Integer getRandomAwardId(Long strategyId);

    /*
     * 根据策略的rule_weight权重规则进行抽奖
     *
     * @author Jackson
     * @date 2025-03-10 14:11
     * @return awardId-奖品ID
     **/
    Integer getRandomAwardId(Long strategyId, String ruleWeightValue);

    /**
     * 获取抽奖策略装配的随机结果(策略抽奖)
     *
     * @param key = strategyId + _ + ruleWeightValue；
     * @return 抽奖结果
     */
    Integer getRandomAwardId(String key);

    /*
     * 根据策略ID和奖品ID，扣减奖品缓存库存
     * @author Jackson
     * @date 2025-03-14 09:56
     * @return null
     **/
    Boolean subtractionAwardStock(Long strategyId, Integer awardId, Date endDateTime);
}
